﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ACM.Master" AutoEventWireup="true" CodeBehind="SearchSaleAdvance.aspx.cs" Inherits="ACM.SearchSaleAdvance" %>

<%@ Register Src="~/UserControls/StatusPanel.ascx" TagPrefix="uc" TagName="StatusPanel" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .input-group
        {
            margin-top: 10px;
        }

        .avoidBootstrap th
        {
            text-align: center;
        }

        .avoidBootstrap td
        {
            padding: 3px;
        }

        .action
        {
            text-align: center;
        }

            .action a:link
            {
                color: #222222;
            }

        table label
        {
            font-weight: normal;
        }

        .Pagination
        {
            line-height: 30px;
            background-color: #ECDBFF;
            text-align: center;
        }

            .Pagination a:link, .Pagination a:visited
            {
                color: black;
            }

        .gridResult th, .gridResult td
        {
            border: 1px solid #fff;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="StatusPlaceHolder" runat="server">
    <uc:StatusPanel ID="Status" runat="server"></uc:StatusPanel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="content" runat="server">
    <div class="page-header" style="margin-top: 0;">
        <h1>ค้นหา</h1>
    </div>

    <div class="row">
        <div class="col-md-8 col-md-offset-2">

            <div class="input-group">
                <span class="input-group-addon"><span class="glyphicon glyphicon-search"></span></span>
                <asp:TextBox ID="txtKeyword" CssClass="form-control" placeholder="กรุณากรอก VIN" runat="server"></asp:TextBox>
            </div>
            <div class="row">
                <div class="col-md-5">
                    <div class="input-group">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                        <asp:TextBox ID="txtSrtDate" CssClass="form-control dateInput" placeholder="จากวันที่" runat="server"></asp:TextBox>
                    </div>
                </div>
                <div class="col-md-5">
                    <div class="input-group">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                        <asp:TextBox ID="txtEndDate" CssClass="form-control dateInput" placeholder="ถึงวันที่" runat="server"></asp:TextBox>
                    </div>
                </div>
                <div class="col-md-2">
                    <asp:Button ID="btnSearch" runat="server" CssClass="btn btn-primary" Text="ค้นหา" Style="width: 100px; float: right; margin-top: 10px;" OnClick="btnSearch_Click" />
                </div>
            </div>
            
            <div class="row">
                <div class="col-md-6 col-md-offset-3">
                    <br />
                    <table width="100%">
                        <tr>
                            <td>
                                <asp:CheckBox ID="CheckBox1" runat="server" Text="&nbsp;ตรวจสอบเอกสาร" /></td>
                            <td>
                                <asp:CheckBox ID="CheckBox2" runat="server" Text="&nbsp;เอกสารครบ" /></td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="CheckBox3" runat="server" Text="&nbsp;เอกสารไม่สมบูรณ์" /></td>
                            <td>
                                <asp:CheckBox ID="CheckBox4" runat="server" Text="&nbsp;จ่ายแล้ว" /></td>
                        </tr>
                    </table>
                </div>
            </div>

        </div>
    </div>

    <div class="row" style="margin-top: 20px;">
        <div class="avoidBootstrap">

            <asp:GridView ID="grdResult" runat="server" Width="100%" CellPadding="4" EnableModelValidation="True" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" CssClass="gridResult" OnRowCommand="grdResult_RowCommand" OnRowDataBound="grdResult_RowDataBound">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField DataField="RowNumber" HeaderText="No." SortExpression="rec_no" ItemStyle-Width="30px">
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                   
                    <asp:BoundField HeaderText="ชื่อ - นามสกุล" DataField="customer_name" ItemStyle-HorizontalAlign="Center" Visible="False">
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField HeaderText="VIN" DataField="vin" ItemStyle-HorizontalAlign="Center">
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField HeaderText="รุ่นรถ" DataField="car_series" ItemStyle-HorizontalAlign="Center">
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField HeaderText="รุ่นย่อย" DataField="car_sub_series" ItemStyle-HorizontalAlign="Center">
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Suffix"  DataField="car_suffix" ItemStyle-HorizontalAlign="Center">
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField HeaderText="วันที่ตัดขาย" DataField="adv_date" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:dd/MM/yyyy}">
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField HeaderText="วันที่ส่งมอบ" DataField="dlv_date" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:dd/MM/yyyy}">
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField HeaderText="ยอดที่ได้รับ" DataField="diff_promotion_amount" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:n0}">
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Note4" DataField="mobile_note4" ItemStyle-HorizontalAlign="Center">
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:BoundField>
                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="สถานะ">
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        <ItemTemplate>
                            <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("tx_status") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="TMT ทำจ่าย" ItemStyle-HorizontalAlign="Center">
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        <ItemTemplate>
                            <asp:label ID="lblApproveDate" runat="server" Text='<%# Eval("approve_date","{0:dd/MM/yyyy}") %>'></asp:label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkEdit" runat="server" CommandName="EditTx" CommandArgument='<%# Eval("id") %>'><span class="glyphicon glyphicon-edit"></span></asp:LinkButton>&nbsp;
                            <asp:LinkButton ID="lnkView" runat="server" CommandName="ViewTx" CommandArgument='<%# Eval("id") %>'><span class="glyphicon glyphicon-list"></span></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <EmptyDataTemplate>
                    <div class="alert alert-danger" role="alert" style="text-align: center; margin-bottom: 0;">
                        <p>ไม่พบข้อมูล</p>
                    </div>
                </EmptyDataTemplate>
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" Height="40" HorizontalAlign="Center" VerticalAlign="Middle" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" Height="30" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            </asp:GridView>

            <asp:Panel ID="pnlConclude" runat="server" CssClass="text-right" Visible="false">
                <br />
                <p>สรุป : Note 4 <asp:Label ID="lblNumNote4" runat="server"></asp:Label> เครื่อง เงินส่วนต่าง <asp:Label ID="lblDiffAmount" runat="server"></asp:Label> บาท</p>
            </asp:Panel>

            <asp:Panel ID="pnlPagination" runat="server" CssClass="Pagination" Visible="false">
                <asp:Repeater ID="rptPageItem" runat="server" OnItemCommand="rptPageItem_ItemCommand">
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="lnkPageNo" CommandName="ChangePage" CommandArgument='<%# Eval("PageId") %>'><%# Eval("PageNo") %></asp:LinkButton>
                    </ItemTemplate>
                </asp:Repeater>
            </asp:Panel>
            <asp:HiddenField ID="hdfPageId" runat="server" />
            <asp:HiddenField ID="hdfRowPerPage" runat="server" />
            <asp:HiddenField ID="hdfTotalRow" runat="server" />


        </div>
    </div>
    <asp:Panel ID="pnlBottom" runat="server" CssClass="row" Visible="false">
        <br />
        <div class="pull-right">
            <asp:Button ID="btnExport" runat="server" Text="Export" CssClass="btn btn-default" />
        </div>
    </asp:Panel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="script" runat="server">
    <script type="text/javascript">
        ActiveMenuIndex(0);
    </script>
</asp:Content>
